package Thread;

public class Demo12 {
    public static void main(String[] args) throws InterruptedException {
        Thread t = new Thread(()->{
            for(int i =0;i<30;i++){
                System.out.println("hallo thread");
            }
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
            System.out.println("t,线程结束");
        });
        t.start();
        t.join(3000,500);
        System.out.println("main 线程结束");
    }
}
